<template>
  <div class="login">
    <div class="form-box" :style="formType === 1 ? 'height:500px' : ''">
      <div class="left">
        <div class="img"></div>
      </div>
      <div class="right">
        <LoginForm v-if="formType === 0"></LoginForm>
        <div class="sign-up-box" :style="formType === 1 ? 'width:100%;' : ''">
          <SignUp v-if="formType === 1"></SignUp>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { computed, reactive } from 'vue'
import { useStore } from 'vuex'
import LoginForm from './components/loginForm.vue'
import SignUp from './components/signUp.vue'
const store = useStore()
const formType = computed(() => store.getters.loginFormType)
// const obj = reactive({
//   formType: 1, // 0 登录 1 注册  2 忘记密码
//   status: 1
// })
</script>

<style lang="scss" scoped>
$bgImg: url('../../assets/298ccf1023.jpg');
.login {
  background: $bgImg;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  width: 100vw;
  height: 100vh;
  position: relative;
  &::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-image: $bgImg;
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
    -webkit-filter: blur(7px);
    -moz-filter: blur(7px);
    -ms-filter: blur(7px);
    -o-filter: blur(7px);
    filter: blur(7px);
  }

  .form-box {
    width: 500px;
    margin: 0 auto;
    height: 400px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    box-shadow: 0px 0px 50px 9px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
    .left {
      width: 130px;
      background: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
      .img {
        background: $bgImg;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        width: 100px;
        height: 100px;
        border-radius: 100px;
        border: 3px solid rgb(202, 202, 202);
      }
    }
    .right {
      flex: 1;
      position: relative;
      background: rgba($color: #000000, $alpha: 0.5);
      .sign-up-box {
        top: 0;
        left: 0;
        position: absolute;
        background: #fff;
        z-index: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 0;
        height: calc(500px - 50px);
        padding: 25px 0;
        transition: 0.2s ease;
        transition-delay: 0.2s;
        border-left: 1px solid rgba(0, 0, 0, 0.1);
        overflow: hidden;
      }
    }
  }
}
</style>
